package com.doge.calcalbum.api

import com.doge.calcalbum.api.model.*
import com.doge.calcalbum.utils.DeviceUtils
import io.reactivex.Observable
import retrofit2.http.*

interface ApiService {
    @GET("api/personInfo")
    fun userInfo(): Observable<ApiResult<UserInfo>>

    @GET("api/buyVipInfo2")
    fun productListV2(): Observable<ApiResult<VipPaymentInfo>>

    @GET("api/createOrder")
    fun createOrder(
        @Query("productId") productId: Int,
        @Query("payMethod") payMethod: Int, // 1微信#2支付宝
        @Query("deviceNo") deviceNo: String = DeviceUtils.deviceId,
    ): Observable<ApiResult<OrderInfo>>

    @GET("api/versionInfo")
    fun versionInfo(): Observable<ApiResult<VersionInfo>>

    @GET("api/wechatPublicChannel")
    fun wechatPublicChannel(): Observable<ApiResult<WechatChannelInfo>>

    @GET("api/eventLog")
    fun uploadEvent(@Query("clickName") clickName: String): Observable<ApiResult<Any>>

    @GET("api/getFreeVip")
    fun getFreeVip(): Observable<ApiResult<UserInfo>>
}